package com.wkbb.sports.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wkbb.sports.model.HlifeTrainGroup;
import com.wkbb.sports.utils.DoubleJacksonSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.wkbb.sports.model.HlifeTrainStudentAvg;
import com.wkbb.sports.utils.DateJacksonConverter;
import com.wkbb.sports.utils.DateJacksonSerializer;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class TrainDto {

    @ApiModelProperty(value = "项目类型名称")
    private String projectKindName;
    @ApiModelProperty(value = "训练模式 0顺序 1随机 2干扰")
    private Integer trainModel;
    @ApiModelProperty(value = "分配模式  0按学号分配 1按设备顺序分配")
    private Integer fpMode;
    @ApiModelProperty(value = "分组人数  0不分组 -1男女分组")
    private Integer groupNum;
    @ApiModelProperty(value = "设备组别")
    private String groupName;
    @ApiModelProperty(value = "团队列表")
    private List<TrainGroupDto> groups;
    @ApiModelProperty(value = "优秀率")
    private Double excellentRate;
    @ApiModelProperty(value = "是否手动录入")
    private Boolean isManual;
    @ApiModelProperty(value = "提交标识")
    private String checkCode;
    @ApiModelProperty(value = "ID")
    private Long id;
    @ApiModelProperty(value = "课堂ID")
    private Long courseId;
    @ApiModelProperty(value = "项目类型(1体检 2体质)")
    private Byte projectType;
    @ApiModelProperty(value = "类型(1训练 2比赛 3测评)")
    private Byte trainType;
    @ApiModelProperty(value = "项目ID")
    private Long projectId;
    @ApiModelProperty(value = "")
    private String projectName;
    @ApiModelProperty(value = "学校ID")
    private Long orgId;
    @ApiModelProperty(value = "年级ID")
    private Long gradeId;
    @ApiModelProperty(value = "年级名称")
    private String gradeName;
    @ApiModelProperty(value = "班级id")
    private Long classId;
    @ApiModelProperty(value = "班级名称")
    private String className;
    @ApiModelProperty(value = "组别")
    private String groupId;
    @ApiModelProperty(value = "老师ID")
    private Long teacherId;
    @ApiModelProperty(value = "训练模式")
    private Byte modelType;
    @ApiModelProperty(value = "标准")
    private Byte markType;
    @ApiModelProperty(value = "项目类型(1跳绳 2跑步)")
    private Byte projectKind;
    @ApiModelProperty(value = "训练标准ID")
    private Long projectRuleId;
    @ApiModelProperty(value = "训练人数")
    private Integer trainCount;
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
    @ApiModelProperty(value = "状态(0未开始 1进行中2已结束3已取消)")
    private Byte status;
    @ApiModelProperty(value = "男生总数")
    private Integer maleTotal;
    @ApiModelProperty(value = "女生总数")
    private Integer femaleTotal;
    @ApiModelProperty(value = "男生总成绩")
    private Double maleCount;
    @ApiModelProperty(value = "男生最大值")
    private Double maleMaxCount;
    @ApiModelProperty(value = "男生最小值")
    private Double maleMinCount;
    @ApiModelProperty(value = "女生总成绩")
    private Double femaleCount;
    @ApiModelProperty(value = "女生最大值")
    private Double femaleMaxCount;
    @ApiModelProperty(value = "女生最小值")
    private Double femaleMinCount;
    @ApiModelProperty(value = "最大分数")
    private Double maxScore;
    @ApiModelProperty(value = "最小分数")
    private Double minScore;
    @ApiModelProperty(value = "平均分数")
    private Double avgScore;
    @ApiModelProperty(value = "男生总分数")
    private Double maleScore;
    @ApiModelProperty(value = "男生最大分数")
    private Double maleMaxScore;
    @ApiModelProperty(value = "男生最小分数")
    private Double maleMinScore;
    @ApiModelProperty(value = "女生总分数")
    private Double femaleScore;
    @ApiModelProperty(value = "女生最大分数")
    private Double femaleMaxScore;
    @ApiModelProperty(value = "女生最小分数")
    private Double femaleMinScore;
    @ApiModelProperty(value = "男生优秀人数")
    private Integer maleFine;
    @ApiModelProperty(value = "男生良好人数")
    private Integer maleGood;
    @ApiModelProperty(value = "男生及格人数")
    private Integer malePass;
    @ApiModelProperty(value = "男生不及格人数")
    private Integer maleFail;
    @ApiModelProperty(value = "女生优秀人数")
    private Integer femaleFine;
    @ApiModelProperty(value = "女生良好人数")
    private Integer femaleGood;
    @ApiModelProperty(value = "女生及格人数")
    private Integer femalePass;
    @ApiModelProperty(value = "女生不及格人数")
    private Integer femaleFail;
    @ApiModelProperty(value = "及格率")
    @JsonSerialize(using = DoubleJacksonSerializer.class)
    private Double passingRate;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "创建人")
    private String createBy;
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;
    @ApiModelProperty(value = "修改人")
    private String updateBy;
    @ApiModelProperty(value = "学生列表")
    private List<TrainStudentDto> students;
    @ApiModelProperty(value = "跑步配置")
    private RunningConfigDto runingConfig;
    @ApiModelProperty(value = "每圈平均成绩列表")
    private List<HlifeTrainStudentAvg> studentAvgs;
    @ApiModelProperty(value = "男生平均成绩")
    private Double maleAvgCount;
    @ApiModelProperty(value = "女生平均成绩")
    private Double femaleAvgCount;
    @ApiModelProperty(value = "男生平均分数")
    private Double maleAvgScore;
    @ApiModelProperty(value = "女生平均分数")
    private Double femaleAvgScore;

//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getMaleAvgScore() {
//        if(maleTotal == null || maleTotal == 0) {
//            return null;
//        }
//        return maleScore / maleTotal;
//    }
//
//    @JsonSerialize(using = DoubleJacksonSerializer.class)
//    public Double getFemaleAvgScore() {
//        if(femaleTotal == null || femaleTotal == 0) {
//            return null;
//        }
//        return femaleScore / femaleTotal;
//    }

    @ApiModelProperty(value = "男生中位数")
    private Double maleMedianCount;
    @ApiModelProperty(value = "女生中位数")
    private Double femaleMedianCount;

    @ApiModelProperty(value = "提高空间-男生平均值")
    private Double maleAvgImproveCount = null;
    @ApiModelProperty(value = "提高空间-男生最大值")
    private Double maleMaxImproveCount = null;
    @ApiModelProperty(value = "提高空间-男生最小值")
    private Double maleMinImproveCount = null;
    @ApiModelProperty(value = "提高空间-女生平均值")
    private Double femaleAvgImproveCount = null;
    @ApiModelProperty(value = "提高空间-女生最大值")
    private Double femaleMaxImproveCount = null;
    @ApiModelProperty(value = "提高空间-女生最小值")
    private Double femaleMinImproveCount = null;
    @ApiModelProperty(value = "提高空间-男生平均分数")
    private Double maleAvgImproveScore = null;
    @ApiModelProperty(value = "提高空间-男生最大分数")
    private Double maleMaxImproveScore = null;
    @ApiModelProperty(value = "提高空间-男生最小分数")
    private Double maleMinImproveScore = null;
    @ApiModelProperty(value = "提高空间-女生平均分数")
    private Double femaleAvgImproveScore = null;
    @ApiModelProperty(value = "提高空间-女生最大分数")
    private Double femaleMaxImproveScore = null;
    @ApiModelProperty(value = "提高空间-女生最小分数")
    private Double femaleMinImproveScore = null;

    @ApiModelProperty(value = "失误最少的同学次数")
    private Integer minErrorCount = null;
    @ApiModelProperty(value = "进入状态最快的同学耗时")
    private Integer minIntoStateTime = null;
    @ApiModelProperty(value = "第一名平均耗时")
    private Integer minAvgTime = null;
    @ApiModelProperty(value = "失误总次数")
    private Integer totalErrorCount = null;
    @ApiModelProperty(value = "失误 损失次数")
    private Integer lossesCount1 = null;
    @ApiModelProperty(value = "甩绳速度偏慢 损失次数")
    private Integer lossesCount2 = null;
    @ApiModelProperty(value = "进入状态过慢 损失次数")
    private Integer lossesCount3 = null;
    @ApiModelProperty(value = "敏捷班级平均时间")
    private Double classAvg;
    @ApiModelProperty(value = "敏捷班级最快")
    private Double classFast;
    @ApiModelProperty(value = "敏捷班级最慢")
    private Double classSlow;
    @ApiModelProperty(value = "时间")
    private Integer gameTime;
    @ApiModelProperty(value = "敏捷男生平均正确率")
    private Double maleRightRate;
    @ApiModelProperty(value = "敏捷女生平均正确率")
    private Double femaleRightRate;
    @ApiModelProperty(value = "敏捷班级平均正确率")
    private Double classRightRate;
    @ApiModelProperty(value = "敏捷男生完成次数")
    private Integer maleFinishCount;
    @ApiModelProperty(value = "敏捷女生完成次数")
    private Integer femaleFinishCount;
    @ApiModelProperty(value = "班级完成次数")
    private Integer classFinishCount;

//    public String getProjectKindName(){
//        switch (projectKind){
//            case 2: return "中长跑";
//            case 3: return "短跑";
//            case 4: return "敏捷";
//            case 6: return "篮球";
//            case 7: return "身高体重";
//            case 8: return "肺活量";
//            case 9: return "体前屈";
//            case 10: return "跳远";
//            case 11: return "仰卧起坐";
//            case 12: return "引体向上";
//            case 13: return "往返跑";
//            case 14: return "实心球";
//            case 15: return "握力";
//            case 16: return "俯卧撑";
//            case 17: return "闭眼单脚站立";
//            case 18: return "篮球运球";
//            case 19: return "足球运球";
//            case 20: return "视力测试仪";
//            default: return "跳绳";
//        }
//    }
}
